package com.example.carbon.dao;

import com.example.carbon.Dto.energy.Search;
import com.example.carbon.pojo.energy.EnergyEfficiency;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface EnergyEfficiencyDao {
    @Select("select  * from energy_efficiency")
    List<EnergyEfficiency> selectAllInfo();
    @Update("update energy_efficiency set detection_name=#{detection_name} " +
            ", detection_address=#{detection_address} , power=#{power} " +
            ", voltage=#{voltage} , state=#{state} , update_time=#{update_time} " +
            ", demo=#{demo} where id =#{id}")
    boolean updateEnergyInfo(EnergyEfficiency energyEfficiency);
    @Delete("delete from energy_efficiency where  id =#{id}")
    boolean deleteEnergyInfo(int id);
    @Insert("insert into energy_efficiency(detection_name,detection_address,power,voltage,state,update_time,demo)" +
            " values (#{detection_name},#{detection_address},#{power},#{voltage},#{state},#{update_time},#{demo})")
    boolean insertNewEnergyInfo(EnergyEfficiency energyEfficiency);
//模糊查询采用mabatis的xml来完成
    List<EnergyEfficiency> searchKeyPoint(Search search);
}
